home *** CD-ROM | disk | FTP | other *** search
Wrap
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN"> <!--Converted with LaTeX2HTML 96.1 (Feb 5, 1996) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds --> <HTML> <HEAD> <TITLE>Segment_To_Descriptor</TITLE> <META NAME="description" CONTENT="Segment_To_Descriptor"> <META NAME="keywords" CONTENT="units"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <LINK REL=STYLESHEET HREF="units.css"> </HEAD> <BODY LANG="EN"> <A NAME="tex2html2208" HREF="node110.htm"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../buttons/next_motif.gif"></A> <A NAME="tex2html2206" HREF="node87.htm"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../buttons/up_motif.gif"></A> <A NAME="tex2html2200" HREF="node108.htm"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../buttons/previous_motif.gif"></A> <A NAME="tex2html2210" HREF="node1.htm"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="../buttons/contents_motif.gif"></A> <A NAME="tex2html2211" HREF="node361.htm"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="../buttons/index_motif.gif"></A> <BR> <B> Next:</B> <A NAME="tex2html2209" HREF="node110.htm">Get_Next_Selector_Increment_Value</A> <B>Up:</B> <A NAME="tex2html2207" HREF="node87.htm">Functions and Procedures</A> <B> Previous:</B> <A NAME="tex2html2201" HREF="node108.htm">Free_Ldt_Descriptor</A> <BR> <P> <H2><A NAME="SECTION005322000000000000000">Segment_To_Descriptor</A></H2> <P> <A NAME="fuSegmentToDescriptor"> </A> <A NAME=3325> </A> <H3><A NAME="SECTION005322100000000000000">Declaration:</A></H3> <P> <tt>Function Segment_To_Descriptor (Seg : Word) : Word;</tt> <H3><A NAME="SECTION005322200000000000000">Description:</A></H3> <P> <tt>Segment_To_Descriptor</tt> Maps a real mode segment (paragraph) address (in <tt>Seg</tt>) onto an descriptor that can be used by a protected mode program to access the same memory. <P> The function returns a selector to the DOS real-mode segment. <P> <EM>Notes:</EM> <UL><LI> Only works with real DPMI.<LI> The descriptors limit will be set to 64KB.<LI> multiple calls to this function with the same segment address will return the same selector.<LI> Descriptors created by this function can never be modified or freed. For this reason this function shouldn't be used too often. Programs which need to examine various real mode addresses using the same selector should use the function <tt>allocate_ldt_descriptors</tt> and change the base address as necessary. </UL><H3><A NAME="SECTION005322300000000000000">Errors:</A></H3> <P> None. <H3><A NAME="SECTION005322400000000000000">See also:</A></H3> <P> <DL ><DT><STRONG>Example</STRONG> <DD> <PRE>uses go32; var r : trealregs; VGAsel : word; begin r.realeax := $13; realintr($10, r); { set VGA mode 13h } VGASel := segment_to_descriptor($A000); {...} seg_fillchar(VGAsel, 100*320+6, 1, 15); { put a pixel at (6/100) in color 15 } readln; {...} r.realeax := $3; realintr($10, r); end.</PRE> <P> </DL><BR> <HR> <P><ADDRESS> <I>Michael Van Canneyt <BR> Tue Mar 31 16:46:10 CEST 1998</I> </ADDRESS> </BODY> </HTML>